#ifndef DBSTORAGE_SQL_SVR_CONNECTION_CONFIG_HPP
#define DBSTORAGE_SQL_SVR_CONNECTION_CONFIG_HPP

#include "DbStorage/DbStorageConfig.hpp"
#include "Storage/ConnectionConfig.hpp"

namespace DbStorage
{

/// @ingroup DbStorage
/// @brief It describes a Microsoft SQL Server database connection.
class DBSTORAGE_API SqlSvrConnectionConfig: public Storage::ConnectionConfig
{
public:
	/// @brief It initializes the description.
	/// @param name the name of the connection.
	SqlSvrConnectionConfig( const std::string& name);

	/// @brief It gets the name of the database server.
	const std::string& serverName() const;
	/// @brief It sets the name of the database server.
	void setServerName( const std::string& newSvrName);

	/// @brief It gets the name of the database.
	const std::string& databaseName() const;
	/// @brief It sets the name of the database.
	void setDatabaseName( const std::string& newDbName);

	/// @brief It gets the name of the user
	const std::string& userName() const;
	/// @brief It sets the name of the user.
	void setUserName( const std::string& newUserName);

	/// @brief It gets the password.
	const std::string& password() const;
	/// @brief It sets the password.
	void setPassword( const std::string& newPassword);

	/// @brief It creates the storage factory that deals with SQL Server database.
	/// @sa Storage::ConnectionConfig::createStorageFactory() const
	virtual Storage::StorageFactory* createStorageFactory() const;
public:
	static const std::string TYPENAME;

private:
	/// @brief The names of the attributes as they are used for persistence of the connection description.
	/// @{
	static const std::string SERVER_NAME_ATTR;
	static const std::string DATABASE_NAME_ATTR;
	static const std::string USER_NAME_ATTR;
	static const std::string PASSWORD_ATTR;
	/// @}

	std::string connectionString() const;
};


} // namespace DbStorage

#endif // DBSTORAGE_SQL_SVR_CONNECTION_CONFIG_HPP
